package org.devops

// 构建类型
def pipeline() {
    node('master') {
        
        stage('CODE') {
            sh 'pwd'
        }

        stage('SONAR') {
            sh '''
                echo ${_version}
                echo ${work_directory}
            '''
        }

        stage('BUILD') {
            sh "export JAVA_HOME=${JAVA_HOME}"
            sh 'echo $JAVA_HOME'
            sh 'mvn clean package -Dmaven.test.skip=true -U -Dmaven.javadoc.skip=true'
        }

        stage('DOCKER') {
            // Docker 构建逻辑
            sh 'echo "docker build..."'
        }

        stage('DEPLOY') {
            // 部署逻辑
            sh 'echo "deploy website..."'
        }

        stage('ARCHIVE') {
            // 制品库上传逻辑
            sh 'echo "upload archive..."'            
        }
    }

}
